//
//  CategoryGoodsCell.m
//  MindBox
//
//  Created by MS on 16-1-5.
//  Copyright (c) 2016年 Lemon. All rights reserved.
//

#import "CategoryGoodsCell.h"
#import "UIImageView+WebCache.h"
#import "UIView+Frame.h"
@interface CategoryGoodsCell ()


@end

@implementation CategoryGoodsCell


-(void)setSon_category:(Son_Category *)son_category
{
    _son_category = son_category;
    
    [_imageView sd_setImageWithURL:[NSURL URLWithString:son_category.image_url]];
    _titleView.text = son_category.name;
    
}

-(void)setLabel_list:(Label_List *)label_list
{
    _label_list = label_list;
    [_subImageView sd_setImageWithURL:[NSURL URLWithString:label_list.image_url]];
    _titleView.text = label_list.name;
}



+(instancetype)cellWithcollectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    
    NSString * className = NSStringFromClass([self class]);
    UINib *  nib = [UINib nibWithNibName:className bundle:nil];
    [collectionView registerNib:nib forCellWithReuseIdentifier:className];
    return [collectionView dequeueReusableCellWithReuseIdentifier:className forIndexPath:indexPath];
    
}

- (void)awakeFromNib {
    // Initialization code

}

-(void)layoutSubviews
{
    [super layoutSubviews];
    if (self.changeImageStyle) {
        self.titleView.textColor = [UIColor colorWithRed:0.55f green:0.55f blue:0.55f alpha:1.00f];
        self.imageView.backgroundColor = [UIColor colorWithRed:0.97f green:0.97f blue:0.97f alpha:1.00f];
        self.imageView.layer.cornerRadius = self.imageView.frame.size.width*0.5;
        self.imageView.clipsToBounds = YES;
       
    }


}

@end
